package OrderPattern;

/**
 * 使用Broker类来接收和执行命令
 */
public class CommandPatternDemo  {
    public static void main(String[] args) {
        Stock abcStock = new Stock();

        BuyStock buyStockOrder = new BuyStock(abcStock);
        sellStock sellStockOrger = new sellStock(abcStock);

        Broker broker = new Broker();
        broker.takeOrder(buyStockOrder);
        broker.takeOrder(sellStockOrger);

        broker.placeOrders();

    }
}
